//
//  FDBaseController.m
//  FamousDoctorOnline
//
//  Created by wszyxc on 16/7/5.
//  Copyright © 2016年 wszyxc. All rights reserved.
//

#import "FDBaseController.h"
#import "JASidePanelController.h"
#import "UIViewController+JASidePanel.h"

@interface FDBaseController ()

@end

@implementation FDBaseController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设定统一的背景颜色
    self.view.backgroundColor = WHITE_COLOR;
    
    //设置导航栏上面的字体颜色
    [self.navigationController.navigationBar setTintColor:WHITE_COLOR];
    
    //设定统一的导航栏背景颜色
    [self.navigationController.navigationBar setBarTintColor:kThemeColor];

    //统一设定导航控制器左边的item的样式
    [self setupLeftNavBarButtonItem];
    
}

- (void)setupLeftNavBarButtonItem{
    
    
    UIBarButtonItem *item = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"JianTou"] style:UIBarButtonItemStylePlain target:self action:@selector(goBack)];
    
    self.navigationItem.leftBarButtonItem = item;
    
}

/**
 *  pop返回
 */
- (void)goBack{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}

/**
 *  返回中间的nav控制器
 */
- (UINavigationController *)centerNavController{
    
    return (UINavigationController *)self.sidePanelController.centerPanel;
    
}

/**
 *  左控制器
 */
- (UIViewController *)leftMenuViewController{
    
    return self.sidePanelController.leftPanel;
    
}

- (void)jumpToOtherViewController:(UIViewController *)otherVC{
    
    //显示中间的控制器
    [self.sidePanelController showCenterPanelAnimated:YES];
    
    //push到指定控制器
    [[self centerNavController] pushViewController:otherVC animated:YES];
    
}




@end
